package com.lt.flashcard.model.entity;

import java.util.Date;

import org.bson.types.ObjectId;

import com.google.code.morphia.annotations.Entity;
import com.google.code.morphia.annotations.Id;
import com.google.code.morphia.annotations.Indexed;

/**
 * Store the test data
 * @author ocsen
 * @version 1.0
 * @created 23-Oct-2012 17:04:51
 */
@Entity("test")
public class Test {

	public static final int STATUS_DRAFT = 0; //init state, building phase
	public static final int STATUS_FINISH = 1; //the test finished
	public static final int STATUS_GOING = 2; //the test is going
	public static final int STATUS_CANCEL = 3; //the test canceled
	
	@Id
	private ObjectId id;
	/**
	 * Store unique code for the test
	 */
	@Indexed(unique=true)
	private String code = "";
	/**
	 * The status of the test
	 */
	private int status;
	/**
	 * The date this test is created
	 */
	private Date created = new Date();
	/**
	 * User id
	 */
	private int uid;
	/**
	 * Total number of questions for this test
	 */
	private int totalquestion = 0;
	/**
	 * The result
	 */
	private int score = 0;
	/**
	 * The time that finish this test
	 */
	private int totaltime = 0;
	/**
	 * The maximum time for this test
	 */
	private int maxtime = 0;
	/**
	 * Current question of the test that user is taking
	 */
	private int currentquestion = 0;
	/**
	 * Store the data for this test
	 */
	private String data = "";
	
	public ObjectId getId() {
		return id;
	}
	
	public void setId(ObjectId id) {
		this.id = id;
	}
	
	public String getCode() {
		return code;
	}
	
	public void setCode(String code) {
		this.code = code;
	}
	
	public int getStatus() {
		return status;
	}
	
	public void setStatus(int status) {
		this.status = status;
	}
	
	public Date getCreated() {
		return created;
	}
	
	public void setCreated(Date created) {
		this.created = created;
	}
	
	public int getUid() {
		return uid;
	}
	
	public void setUid(int uid) {
		this.uid = uid;
	}
	
	public int getTotalquestion() {
		return totalquestion;
	}
	
	public void setTotalquestion(int totalquestion) {
		this.totalquestion = totalquestion;
	}
	
	public int getScore() {
		return score;
	}
	
	public void setScore(int score) {
		this.score = score;
	}
	
	public int getTotaltime() {
		return totaltime;
	}
	
	public void setTotaltime(int totaltime) {
		this.totaltime = totaltime;
	}
	
	public int getMaxtime() {
		return maxtime;
	}
	
	public void setMaxtime(int maxtime) {
		this.maxtime = maxtime;
	}
	
	public int getCurrentquestion() {
		return currentquestion;
	}
	
	public void setCurrentquestion(int currentquestion) {
		this.currentquestion = currentquestion;
	}
	
	public String getData() {
		return data;
	}
	
	public void setData(String data) {
		this.data = data;
	}
}